<h2 mat-dialog-title mat-line>
  {{stepConfig.title}}
</h2>
<mat-dialog-content [ngStyle]="{height: actions.length > 0 ? 'auto' : '30px'}">
  <form [formGroup]="formGroup">
    <mat-spinner [diameter]="25" *ngIf="!actions || actions.length === 0"></mat-spinner>
    <mat-form-field *ngIf="actions.length > 0" class="full-width">
      <mat-label>action</mat-label>
      <mat-select (valueChange)="selectAction(actions[$event])" formControlName="action">
        <mat-option *ngFor="let action of actionNames" [value]="action">{{action}}</mat-option>
      </mat-select>
    </mat-form-field>
    <mat-form-field *ngFor="let arg of actionArgs" class="full-width">
      <mat-label>{{arg[0]}}</mat-label>
      <mat-select *ngIf="arg[0] === 'mode'; else input" [formControlName]="arg[0]">
        <mat-option>None</mat-option>
        <mat-option *ngFor="let mode of modes" [value]="mode">{{mode}}</mat-option>
      </mat-select>
      <ng-template #input>
        <input matInput [type]="arg[1]" [formControlName]="arg[0]">
      </ng-template>
    </mat-form-field>
  </form>
</mat-dialog-content>
<mat-dialog-actions>
  <button [disabled]="formGroup.invalid" type="button" mat-raised-button color="primary" (click)="submit()">确定</button>
  <button type="button" mat-raised-button mat-dialog-close>取消</button>
</mat-dialog-actions>
